package tcp

import (
	"engine/internal"
	"gitee.com/ameise84/e3dds"
)

var (
	_gService     service
	_gActorServer e3dds.NetService
	_gMsgPackHand internal.NetMsgTransformHandler
)

func Start(opts internal.Options, netService e3dds.NetService, msgHand internal.NetMsgTransformHandler) (addr string, err error) {
	_gActorServer = netService
	_gMsgPackHand = msgHand
	return _gService.start(netService.GetServiceID(), opts)
}

func Stop() {
	_gService.stop()
}
